package com.ytc.mapper;

import com.ytc.model.User;

import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
* @author 25645
* @description 针对表【my_user(用户表)】的数据库操作Mapper
* @createDate 2023-01-09 17:31:10
* @Entity com.ytc.model.User
*/

public interface UserMapper {
    int deleteByPrimaryKey(Integer uId);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer uId);

    int updateByPrimaryKeySelective(User record);

    User queryUserById(@Param("uId") Integer uId);

    //判断用户是否是Vip
    Integer isOrNotVip(@Param("uId") Integer uId);

    //张阔：修改用户权限
    void updateRole(@Param("uId") Integer uId,@Param("rId") Integer rId);


    /*柴晓颖：注册时新增用户*/
    void addUser(User user);

    List<User> queryUserList();

    /*柴晓颖：修改用户角色id为作者*/
    void updateRoleId(@Param("user") User user,@Param("userResid") Integer userResid);

    //张泽萌
    void updateAuthor(User user);

    //柴晓颖：通过用户名查询用户
    User queryUserByName(@Param("uName") String uName);

    //柴晓颖：新增用户关联关系表
    void addUserRole(User user);

    /*高媛：通过用户ID查找用户信息*/
    User queryUserInfoById(@Param("userid")Integer userid);


}
